home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / HSI2ARR.ZIP / HISTEST3.C < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-17  |  889 b   |  52 lines

  1. /* HISTEST3.C -- Coded by Darion.  August 16th, 1994
  2.  * Written as example for HSI2ARR.C                  */
  3. #include <stdio.h>
  4. #include <dos.h>
  5. #include <stdlib.h>
  6. #include "knight.h"
  7.  
  8. #define CENTERW (320-WIDTH) / 2
  9. #define CENTERH (200-HEIGHT) / 2
  10. #define VIDEO 0x10
  11.  
  12.  
  13. char far *video_ptr=(char far *)0xA0000000;
  14.  
  15. void main(void)
  16. {
  17.     union REGS regs;
  18.     struct SREGS sregs;
  19.  
  20.     int x,y=0;
  21.  
  22.     regs.h.al=0x13;
  23.     regs.h.ah=0x00;
  24.     int86(VIDEO, ®s, ®s);
  25.  
  26.     sregs.es = FP_SEG(PALDATA);
  27.     regs.h.al=0x12;
  28.     regs.h.ah=0x10;
  29.     regs.x.bx=0;
  30.     regs.x.cx=PICDATA_COLORS;
  31.     regs.x.dx=FP_OFF(PALDATA);
  32.     int86x(VIDEO, ®s, ®s, &sregs);
  33.  
  34.  
  35.     for(x = 0;x < PICDATA_HEIGHT;x++)
  36.         {
  37.         for(y = 0;y < PICDATA_WIDTH;y++)
  38.             *(video_ptr+(x*320)+y)=PICDATA[x][y];
  39.         }
  40.  
  41.  
  42.     while(!kbhit());
  43.     x=getch();
  44.  
  45.     regs.h.al=0x03;
  46.     regs.h.ah=0x00;
  47.     int86(VIDEO, ®s, ®s);
  48.  
  49.  
  50. }
  51.  
  52.